import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '缺陷等级',
    align: "center",
    dataIndex: 'defectLevel_dictText'
  },
  {
    title: '权重值',
    align: "center",
    dataIndex: 'defectLevelWeight'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '缺陷等级',
    field: 'defectLevel',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "defect_level"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入缺陷等级!'},
             ];
    },
  },
  {
    label: '权重值',
    field: 'defectLevelWeight',
    component: 'InputNumber',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入权重值!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  defectLevel: {title: '缺陷等级',order: 0,view: 'list', type: 'string',dictCode: 'defect_level',},
  defectLevelWeight: {title: '权重值',order: 1,view: 'number', type: 'number',},
};
